﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>指令(command)</title>
    <link href="style.css" rel="stylesheet" />
</head>
<body>
    <div id="demo">
        <script type="text/html">
            {{view controller="main" name="main" app="demo" /}}
            <div style="display:none;" show="[[isShow]]">显示</div>
        </script>
    </div>
    <script src="../scripts/bingo2/bingo.min.js"></script>
    <script src="route.js"></script>
    <script type="text/javascript">
        (function () {
            var app = bingo.app('demo');

            app.controller('main', function ($view) {

                $view.isShow = true;

            });
            //定义一个show属性
            app.attr('show', function (vAttr) {

                //
                vAttr.$layoutResult(function (c) {
                    var val = c.value;
                    if (val) vAttr.$show(); else vAttr.$hide();
                });

            });

        })();
        
        bingo.ready(function () {
            console.time('boot');
            bingo.compile(document.getElementById('demo')).then(function () {
                //console.profileEnd('boot');
                console.timeEnd('boot');
            });
        });
    </script>
</body>
</html>
